<?php
ob_start();
include_once("../../config.php");
$id =intval($_GET['id']);
$et =intval($_GET['et']);
if($_COOKIE['digg'.$id]=='' || empty($_COOKIE['digg'.$id]) ){
	setcookie("digg".$id, $id, time()+3600);  /* expire in 1 hour */
	//读写数据库操作部分
	if($et==1){
		mysql_query("update ".$prefix."shoplist set s_up=s_up+1 where s_id=".$id);
	}else{
		mysql_query("update ".$prefix."shoplist set s_down=s_down+1 where s_id=".$id);
	}
	echo "var re=new Array();re[0]=".$id.";re[1]=".$et.";re[2]=\"success\";re[3]=\"投票成功！\";";
}else{
	echo "var re=new Array();re[0]=".$id.";re[1]=".$et.";re[2]=\"fail\";re[3]=\"嬲你的,囧^__^,不是刚刚顶过吗！！\";";
}
ob_end_flush();

?>